import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import 'bootstrap/dist/css/bootstrap.min.css'
// import 'bootswatch/dist/sandstone/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min.js'

import './assets/style/reset.css'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import connector from './utils/interface'
Vue.prototype._http=connector;

import VueI18n from 'vue-i18n'
Vue.use(VueI18n);

const i18n = new VueI18n({
  locale: window.localStorage.getItem('language') == null ? "zh-CN" : window.localStorage.getItem('language'),
  //this.$i18n.locale // 通过切换locale的值来实现语言切换
  messages: {
    'zh-CN': require('./assets/language/zh'),
    'en-US': require('./assets/language/en'),
    'ja-JP': require('./assets/language/ja'),
  }
});
Vue.config.productionTip = false

// 鼠标移入自动获得焦点指令
Vue.directive('autoFocus',{
  inserted:function (el) {
    el.onmouseover = function(){
      this.focus();
    }
    el.onmouseout  = function(){
      this.blur();
    }
  }
});

new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
